
import request, { singleRequest } from '@/utils/request'
/**
 *@Description 数据趋势 - 舱位发布趋势 数据加载 接口.
 *@Return .
**/
export const cabinPushTrend = async (data = {}) => {
    const res = await singleRequest({
        url: '/shippingSpace/pushTrend',
        method: 'post',
        data,
    })
    return res
}
/**
 *@Description 数据趋势 - 舱位发布次数排行榜.
 *@Return .
**/
export const cabinPushRank = async (data = {}) => {
    const res = await singleRequest({
        url: '/shippingSpace/pushRanking',
        method: 'post',
        data,
    })
    return res
}
/**
 *@Description 历史统计 数据查询 接口.
 *@Return .
**/
export const cabinHisStat = async (data = {}) => {
    const res = await singleRequest({
        url: '/shippingSpace/statHis',
        method: 'post',
        data,
    })
    return res
}
/**
 *@Description 历史统计 数据导出 接口.
 *@Return .
**/
export const cabinHisExport = async (data = {}) => {
    const res = await singleRequest({
        url: '/shippingSpace/statHisExport',
        method: 'post',
        data,
        responseType: 'arraybuffer',
    })
    return res
}
/**
 *@Description 数据趋势 - 用户新增趋势 数据加载 接口.
 *@Return .
**/
export const cabinUserIncreaseTrend = async (data = {}) => {
    const res = await singleRequest({
        url: '/shippingSpace/newIncreaseTrend',
        method: 'post',
        data,
    })
    return res
}
/**
 *@Description 舱位数据报表 - 发布数统计 数据.
 *@Return .
**/
export const cabinStatMap = async () => {
    const res = await request({
        url: '/shippingSpace/statMap',
        method: 'get',
    })
    return res
}
/**
 *@Description 舱位信息分页查询 接口.
 *@Return .
**/
export const queryCabinList = async (data = {}) => {
    const res = await singleRequest({
        url: '/shippingSpace/page',
        method: 'post',
        data,
    })
    return res
}
export const queryCabinDetailList = async (data = {}) => {
    const res = await singleRequest({
        url: '/shippingSpace/getPublishDetail',
        method: 'post',
        data,
    })
    return res
}
/**
 *@Description 舱位交易 - 舱位发布详情 - 删除发布的演示数据 注意:参数为舱位id.
 *@Return .
**/
export const deleteRecord = async (shippingSpaceId) => {
    const res = await request({
        url: `/shippingSpace/publish-del/${shippingSpaceId}`,
        method: 'get',
    })
    return res
}
/**
 *@Description 数据统计 - 数据报表 - list 数据查询.
 *@Return .
**/
export const pageAba = async (data = {}) => {
    const res = await singleRequest({
        url: '/data/page-aba',
        method: 'post',
        data,
    })
    return res
}
/**
 *@Description 数据统计 - 数据报表 - 数据导出.
 *@Return .
**/
export const exportAba = async (data = {}) => {
    const res = await singleRequest({
        url: '/data/export-aba',
        method: 'post',
        data,
        responseType: 'arraybuffer',
    })
    return res
}
/**
 *@Description 经销商列表 = 导出.
 *@Return .
 **/
export const exportDealer  = async (data = {}) => {
    const res = await singleRequest({
        url: '/common/dealer-export',
        method: 'post',
        data,
        responseType: 'arraybuffer',
    })
    return res
}
/**
 *@Description 经销商信息分页查询.
 *@Return .
**/
export const queryDealer  = async (data = {}) => {
    const res = await singleRequest({
        url: '/common/dealer-page',
        method: 'post',
        data,
    })
    return res
}
/**
 *@Description 经销商保存.
 *@Return .
**/
export const saveDealer  = async (data = {}) => {
    const res = await singleRequest({
        url: '/common/dealer-save',
        method: 'post',
        data,
    })
    return res
}
/**
 *@Description 删除经销商.
 *@Return .
**/
export const delDealer  = async (id = '') => {
    const res = await singleRequest({
        url: `/common/dealer/${id}`,
        method: 'get',
    })
    return res
}

export const cabinExport = async (data = {}) => {
    const res = await singleRequest({
        url: '/shippingSpace/export',
        method: 'post',
        data,
        responseType: 'arraybuffer',
    })
    return res
}
export const cabinDetailExport = async (data = {}) => {
    const res = await singleRequest({
        url: '/shippingSpace/exportDetail',
        method: 'post',
        data,
        responseType: 'arraybuffer',
    })
    return res
}
export const getReleaseCompany = async (params = {}) => {
    const res = await singleRequest({
        url: '/shippingSpace/getReleaseCompany',
        method: 'get',
        params,
    })
    return res
}
